/**
 * Created by vicket on 2017/4/16.
 */
$(function(){
    var sendBtn=$(".send_btn");
    var feedback=$(".feedback");
    var phone=$(".phone");
    var userId=sessionStorage.getItem("userId");

    //弹出层
    var windowHeight=$(window).height();
    var maskTip=$(".mask_tip");
    maskTip.height(windowHeight);
    maskTip.css("display","none");
    var maskText=$(".mask_content p");
    sendBtn.click(function(){
        var feedbackVal=feedback.val();
        var phoneVal=phone.val();
        $.ajax({
            type:"post",
            url:"/api/frontGetMessage",
            data:{uId:userId,message:feedbackVal,uInfo:phoneVal},
            success:function(result){
                maskText.text(result.message);
                maskTip.css("display","block");
                setTimeout(function(){
                    maskTip.css("display","none");
                    feedback.val("");
                    phone.val("");
                },2000)


            },
            error:function(){
                alert("发送失败");
            }
        })
    })
})